<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function displayDate() {
      document.getElementById("demo").innerHTML = Date();
    }
  </script>
</head>
<body>
  <h1>JavaScript程序</h1>
  <p id="demo">这是一个段落</p>
  <button type="button" onclick="displayDate()">显示日期</button>
</body>
</html>